﻿using System.Web.Mvc;

namespace KM.Areas.KM
{
    public class KMAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "KM";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
               "KM_index",
               "{thanhpho}",
               new { Controller = "Home", action = "Index", thanhpho = UrlParameter.Optional }
           );

            context.MapRoute(
               "KM_DanhMuc",
               "{thanhpho}/{id}",
               new { Controller = "KhuyenMai", action = "GetKhuyenMaiByLoaiKhuyenMai", thanhpho = UrlParameter.Optional, id = UrlParameter.Optional }
           );

            context.MapRoute(
                "KM_default",
                "{controller}/{action}/{id}",
                new { Controller="Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
